From cd300835d76381c4ad16a9c87e305199a284f7fa Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 3 Feb 2012 01:41:07 -0500 Subject: [PATCH] Allow context menus on scale sliders This will be used for a popup in the color chooser. --- gtk/gtkrange.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index ddd669cb74..14c72f9d2a 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -2548,6 +2548,16 @@ gtk_range_button_press (GtkWidget *widget, if (gtk_range_update_mouse_location (range)) gtk_widget_queue_draw (widget); + if (priv->mouse_location == MOUSE_SLIDER && + gdk_event_triggers_context_menu ((GdkEvent *)event)) + { + gboolean handled; + + g_signal_emit_by_name (widget, "popup-menu", &handled); + + return TRUE; + } + if (priv->mouse_location == MOUSE_TROUGH && event->button == GDK_BUTTON_PRIMARY) { -- 2.30.2